var status = -1;
var selectionLog = [];

function action(d, c, b) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            cm.npc_ChangeController(1540795, "oid=58959", 591, -14, 4, 541, 641, 1, false, 0, false);
            cm.setAmbience("Ambience.img/gravity", 100, 60);
            cm.updateInfoQuest(33915, "act1=350112400;act2=350123600;act3=350130800");
            cm.showMapleHero();
            cm.npc_ChangeController(1540881, "oid=306107269", 1261, -27, 2, 1211, 1311, 1, false, 0, false);
            cm.npc_SetSpecialAction("oid=306107269", "summon", 0, 0);
            cm.setNpcSpecialActionReset("oid=306107269");
            cm.dispose()
        }
    }
}

function start() {
    status = -1;
    action(1, 0, 0)
};